{% extends "base.html" %}
{% block content %}
    {% if not user.is_authenticated  %}
    
    <h2> Hello there new guy! Please log in: </h2>
    {% if error %}
        <p class="error">Sorry, that's not a valid username or password</p>
    {% endif %}

    <form action="login" method="post">
        {% csrf_token %}
        <label for="username">User name:</label>
        <input type="text" name="username" value="" id="username">
        <br>
        <label for="password">Password:</label>
        <input type="password" name="password" value="" id="password">
        <br>
        <input type="submit" value="login" />
        <input type="hidden" name="next" value="{{ next|escape }}" />
    </form>
    {% else %} 
    <h2> Hello there {{ user }} ! </h2>
    {% endif %}
{% endblock %}
